package cn.lee.share.utils;

import javax.swing.JTextArea;

public class LogUtils {
    private static LogUtils logUtils= new LogUtils();
    JTextArea textArea;
    private LogUtils(){
        
    }
    public static LogUtils getInstance(){
        return logUtils;
    }
    
    
    public void setTextArea(JTextArea textArea) {
        this.textArea = textArea;
    }
    
    public void log(String mes){
        if(textArea ==null){
            return;
        }
        textArea.append(mes+"\n");
//        textArea.repaint();
        textArea.paintImmediately(textArea.getBounds());
    }
}
